package com.cos.springboot.lession67.web.controller;

import com.cos.springboot.lession67.common.TxYunProperties;
import com.cos.springboot.lession67.entity.User;
import com.cos.springboot.lession67.services.UserServices;
import com.cos.springboot.wahaha.EmpServicesImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: COS
 * @time: 2021/12/1 9:39
 * @description:
 */
@RestController
@RequestMapping("/test")
public class TestController {
    @RequestMapping("/hello")
    public String hello(){
        return "Hello SpringBoot";
    }
    @Autowired
    private User user;
    @Autowired
    private UserServices us;

    @RequestMapping("/getUser")
    public User getUser(){
        return user;
    }
    @RequestMapping("/getUser2")
    public User getUser2(){
        return us.getUser();
    }


    @Autowired
    private EmpServicesImpl empServices;
    /**
     *
     * @author: COS
     * @return:
     * @time: 2021/12/1 11:29
     * @description: 读取配置文件的值
     */
    @Value("${qf2108}")
    private String value;
    @Autowired
    private TxYunProperties tx;
    @RequestMapping("/t1")
    public String t1(){
        System.out.println(value);
        System.out.println(tx);
        return "测试2";
    }

}
